
import {effect, ref} from '@vue/reactivity';
import { _decorator, Button, Component, director, find, Label, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Test')
export class Test extends Component {

    @property(Node)
    countLabel: Node;
    @property(Node)
    addNode: Node;

    count = ref(0);

    start() {
        let node = find("Canvas")
        console.log("node:",node.uuid);
        // console.log("ref1:",process.env);3.5.13
        // console.log("ref:",ref);
        effect(() => {
            this.countLabel.getComponent(Label).string = this.count.value.toString();
        });
        this.addNode.on(Button.EventType.CLICK, () => {
            this.count.value += 1;
            // director.loadScene('Main');
        });
    }

    update(deltaTime: number) {
        

    }


}


